package com.huadao.pda.modle;

import android.content.Context;

import com.huadao.pda.base.BaseHttpModel;
import com.huadao.pda.data.bean.BaseBean;
import com.huadao.pda.data.bean.User;
import com.huadao.pda.data.http.Api;
import com.huadao.pda.data.http.HttpFunction;
import com.huadao.pda.data.http.HttpLoginFunction;
import com.huadao.pda.data.http.RetrofitHelper;

import io.reactivex.Observable;


public class LoginModle extends BaseHttpModel {
    private Api api;

    public LoginModle(Context context) {
        api=RetrofitHelper.getInstance(context).create(Api.class);
    }

    public Observable<String> login(String userName, String password){
        User user=new User();
        user.setEmail(userName);
        user.setPassword(password);
        user.setIsLongTime(0);
        return api.login("http://192.168.1.10:57825/api/Account/SignIn",user).map(new HttpLoginFunction());
    }
}
